package utils;

public class StringToArray {
    public static String[] convertStrToArray(String str){
        String[] strArray = null;
        strArray = str.split(","); //拆分字符为"," ,然后把结果交给数组strArray
        return strArray;
    }

    public static String[] convertStrToArray1(String str){
        String[] strArray = null;
        String[] strArrayNull={""};


        if(str!=null) {
            strArray = str.split("\\|"); //拆分字符为"|" ,然后把结果交给数组strArray
            return strArray;
        }else{

            return strArrayNull;
        }
    }
}
